var ERC20 = artifacts.require('./test/ERC20.sol');
var Weth = artifacts.require('./tets/WETH9.sol');
var UniswapV2Router02 = artifacts.require('./UniswapV2Router02.sol');
const config = require('./constans');
/**
 * 先去部署factory合约
 * 1.部署2个新币
 * 2.部署weth
 * 3.部署router
 * @param deployer
 */
module.exports = function (deployer){
    // var factory_address = config.factory_address;//工厂合约
    // var tokena_address = '';
    // var tokenb_address = '';
    // var weth_address = '';
    // deployer.then(function() {
    //     var name = "test 001";
    //     var symbol = "TESTONE";
    //     var total = 20000000000;
    //     //部署一个tokenA
    //     return deployer.deploy(ERC20,name,symbol,total);
    // }).then(function(instance) {
    //     tokena_address = instance.address;
    //     var name1 = "test 002";
    //     var symbol1 = "TESTOTWO";
    //     var total1 = 30000000000;
    //     //部署一个tokenB
    //     return deployer.deploy(ERC20,name1,symbol1,total1);
    // }).then(function(instance) {
    //     //部署一个WETH
    //     tokenb_address = instance.address;
    //     return deployer.deploy(Weth);
    // }).then(function(instance) {
    //     weth_address = instance.address;
        // var  _adminAddress = config.adminAddress; //00账号
        // var  _feeAddress = config.feeAddress;   //02账号
    //     var  _swapFee = 3;
    //     var  _addLiquidityFee = 3;
    //     var  _removeLiquidityFee =3;
    //     return deployer.deploy(UniswapV2Router02,factory_address,weth_address,_adminAddress,_feeAddress,_swapFee,_addLiquidityFee,_removeLiquidityFee);
    // })



    // deployer.then(function() {
    //     var name = "test 001";
    //     var symbol = "TESTONE";
    //     var total = 20000000000;
    //     //部署一个tokenA
    //     return   ERC20.deployed(name,symbol,total);
    // }).then(function(instance) {
    //     tokena_address = instance.address;
    //     console.log('tokenA',tokena_address)
    //     var name1 = "test 002";
    //     var symbol1 = "TESTOTWO";
    //     var total1 = 30000000000;
    //     //部署一个tokenA
    //     return   ERC20.deployed(name1,symbol1,total1);
    // }).then(function(instance) {
    //     tokenb_address= instance.address;
    //     return   Weth.deployed();
    // }).then(function(instance) {
    //     weth_address = instance.address;
    //     var  _adminAddress = "0xc783df8a850f42e7f7e57013759c285caa701eb6"; //00账号
    //     var  _feeAddress = "0xe5904695748fe4a84b40b3fc79de2277660bd1d3";   //02账号
    //     var  _swapFee = 3;
    //     var  _addLiquidityFee = 3;
    //     var  _removeLiquidityFee =3;
    //     return UniswapV2Router02.deployed(factory_address,weth_address,_adminAddress,_feeAddress,_swapFee,_addLiquidityFee,_removeLiquidityFee);
    // })
};
